
--doris
create  table jms_dm.dm_first_code_optimize
(
 date_time          date COMMENT '揽收时间'
,first_code         varchar(100) COMMENT '一段码'
,name               varchar(100) COMMENT '建包名称'
,type               varchar(100) COMMENT '建包类型'
,dest_center_code   varchar(100) COMMENT '目的中心code'
,dest_center_name   varchar(100) COMMENT '目的中心name'
,center_code        varchar(100) COMMENT '末端机构编码'
,center_name        varchar(100) COMMENT '末端机构名称'
,first_code_count   bigint COMMENT '一段码揽收量'
,taking_date_count  bigint COMMENT '日揽收总量'

)
ENGINE = OLAP
DUPLICATE KEY( date_time,first_code)
COMMENT "一段码优化"
PARTITION BY RANGE(date_time)
(START ("2022-12-15") END ("2023-01-30") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(date_time,first_code) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);